package com.pcl.mvvm.network.api

import com.cxh.rmsq.db.model.AddressBean
import com.cxh.rmsq.db.model.AuthenticationBean
import com.cxh.rmsq.db.model.MineBean
import com.cxh.rmsq.net.self.BaseResult
import okhttp3.MultipartBody
import retrofit2.http.*

/**
 *   @auther : Aleyn
 *   time   : 2019/10/29
 */
interface DeBugApiService {

    @POST("app-api/member/auth/send-sms-code")
    suspend fun getSendSmsCode(@Body mapOf: HashMap<String, Any>): BaseResult<Any>

//    @POST("app-api/member/auth/sms-login")
//    suspend fun getSmsLogin(@Body mapOf: HashMap<String, Any>): BaseResult<LoginBean?>
//
//    @POST("app-api/member/auth/login")
//    suspend fun getLogin(@Body mapOf: HashMap<String, Any>): BaseResult<LoginBean?>

    @POST("app-api/member/auth/logout")
    suspend fun getLogout(@Body mapOf: HashMap<String, Any>): BaseResult<Any?>

    @POST("app-api/member/name-authentication/create")
    suspend fun setAuthentication(@Body mapOf: HashMap<String, Any>): BaseResult<Any?>

    @GET("app-api/member/name-authentication/get")
    suspend fun getAuthentication(@Query("userId") userId: Int): BaseResult<AuthenticationBean?>

    @PUT("app-api/member/user/update")
    suspend fun getUserUpdate(@Body mapOf: HashMap<String, Any>): BaseResult<Any?>

    @GET("app-api/member/region/list")
    suspend fun getProvinceList(): BaseResult<ArrayList<AddressBean>>

    @GET("app-api/member/region/list")
    suspend fun getCityList(@Query("code") code: String): BaseResult<ArrayList<AddressBean>>

    @GET("app-api/member/region/list")
    suspend fun getAreaList(@Query("code") code: String): BaseResult<ArrayList<AddressBean>>

    @GET("app-api/member/user/get")
    suspend fun getUserInfo(@Query("userId") userId: String): BaseResult<MineBean?>

    @Multipart
    @POST("app-api/infra/file/upload")
    suspend fun getFileUpdate(@Part file: MultipartBody.Part): BaseResult<String?>

    // 修改密码
    @PUT("app-api/member/user/update-password")
    suspend fun changePwd(@Body mapOf: HashMap<String, Any>): BaseResult<Any?>

    // 修改绑定手机
    @PUT("app-api/member/user/update-mobile")
    suspend fun changePhone(@Body mapOf: HashMap<String, Any>): BaseResult<Any?>
}
